assume cs:code,ds:data
data segment
    arr db 1,2,3,4,5,4,3,2,1,'$'
    print db 'end','$'
    max db 0,'$'
data ends
code segment
start:
    mov ax,data 
    mov ds,ax
    mov cx,0FFFFH
    mov dx,offset max
    mov bx,offset arr
s:
    mov al,[bx]
    cmp al,'$'
    jz j
    cmp max,al
    jnb maxbig
    mov max,al
maxbig:
    add bx,1
    loop s
j:
    add max,48
    mov ah,9
    int 21H
    mov ah,4CH
    int 21H
code ends
end start
end
    
